app.service('columnEditService',['$q','utilService',function($q,utilService){
    var _this_=this;
    _this_.column={};

    _this_.findById = function($scope){
        var deferred = $q.defer();
        utilService.get({
            url:$scope.app.domain + 'column/'+$scope.id,
        }).then(function(response){
            deferred.resolve(response.data);
        },function(e){
            console.error(e);
            deferred.reject("连接服务器出错");
        });
        return deferred.promise;
    }


    //禁用启用
    _this_.editColumn = function($scope){
        var deferred = $q.defer();
        utilService.api({
            url:$scope.app.domain + 'column',
            data:_this_.column,
            method:'PUT'
        }).then(function(result){
            deferred.resolve(result);
        });
        return deferred.promise;
    }
}]);
